package com.job.shuang.HomeWork0712;

/**
 * @author Liushuang
 * @version 1.0
 * @since 2022-07-12 20:54:08
 */
public class TigerGarden {//工厂模式
    public static Attack getAttack(String num){
        if (num.equals("A")){
            return new NoAttack();
        }else if (num.equals("B")){
            return new CanAttack();
        }else if (num.equals("C")){
            return new AttackSupper();
        }else {
            Attack attack=new Attack() {
                @Override
                public void attackAction() {
                    System.out.println("老虎默认的攻击能力！");
                }
            };
            return attack;
        }
    }
}
